package com.coollang.smartbra.utils;

import com.coollang.smartbra.R;

/**
 * Created by Administrator on 2016/11/14 0014.
 */

public class ShowErrorToast {
    /*    '200' => '请求成功',
                '-9999' => '接口请求失败',
                '-10000' => '请求超时',
                '-10001' => '非法请求',
                '-10002' => '异常用户',
                '-10003' => '未登录',
                '-10004' => '接口不存在',
                '-10005' => '系统错误',
                '-10006' => '参数传递错误',
                '-10007' => '缺少参数',
                '-10008' => '非法参数',
                '-20001' => '设备已被其他用户绑定',
                '-20002' => '设备已绑定',

                '-30001' => '计划不存在',
                '-30002' => '不能重复添加新计划',
                '-30003' => '用户未制定计划',
                '-30004' => '日期传递错误',

                '-40001' => '图片上传失败',
                '-40002' => '文件类型不符合,仅支持gif|jpg|png',

                '-50000' => '注册失败',
                '-50001' => '用户名或密码错误',
                '-50003' => '用户未注册',
                '-50004' => '用户已注册',
                '-50005' => '手机格式错误',
                '-50006' => '密码格式设置错误',
                '-50007' => '验证码错误',

                '-60001' => '运动数据上传失败',

                '-517' => '缺少必要的请求参数',
                '-518' => '请求中用户的手机号格式不正确（包括手机的区号）',
                '-519' => '请求发送验证码次数超出限制',
                '-520' => '无效验证码',
                '-526' => '短信余额不足',*/
    public static void show(String code){
        switch (Integer.parseInt(code)){
            case 200:
                ToastUtils.showToast(UIUtils.getString(R.string.error0));
                break;
            case -9999:
                ToastUtils.showToast(UIUtils.getString(R.string.error1));
                break;
            case -10000:
                ToastUtils.showToast(UIUtils.getString(R.string.error2));
                break;
            case -10001:
                ToastUtils.showToast(UIUtils.getString(R.string.error3));
                break;
            case -10002:
                ToastUtils.showToast(UIUtils.getString(R.string.error4));
                break;
            case -10003:
                ToastUtils.showToast(UIUtils.getString(R.string.error5));
                break;
            case -10004:
                ToastUtils.showToast(UIUtils.getString(R.string.error6));
                break;
            case -10005:
                ToastUtils.showToast(UIUtils.getString(R.string.error7));
                break;
            case -10006:
                ToastUtils.showToast(UIUtils.getString(R.string.error8));
                break;
            case -10007:
                ToastUtils.showToast(UIUtils.getString(R.string.error9));
                break;
            case -10008:
                ToastUtils.showToast(UIUtils.getString(R.string.error10));
                break;
            case -20001:
                ToastUtils.showToast(UIUtils.getString(R.string.error11));
                break;
            case -20002:
                ToastUtils.showToast(UIUtils.getString(R.string.error12));
                break;
            case -30001:
                ToastUtils.showToast(UIUtils.getString(R.string.error13));
                break;
            case -30002:
                ToastUtils.showToast(UIUtils.getString(R.string.error14));
                break;
            case -30003:
                ToastUtils.showToast(UIUtils.getString(R.string.error15));
                break;
            case -30004:
                ToastUtils.showToast(UIUtils.getString(R.string.error16));
                break;
            case -40001:
                ToastUtils.showToast(UIUtils.getString(R.string.error18));
                break;
            case -40002:
                ToastUtils.showToast(UIUtils.getString(R.string.error19));
                break;
            case -50000:
                ToastUtils.showToast(UIUtils.getString(R.string.error20));
                break;
            case -50001:
                ToastUtils.showToast(UIUtils.getString(R.string.error201));
//                ToastUtils.showToast(UIUtils.getString(R.string.login_fail));
                break;
            case -50003:
                ToastUtils.showToast(UIUtils.getString(R.string.error202));
                break;
            case -50004:
                ToastUtils.showToast(UIUtils.getString(R.string.error203));
                break;
            case -50005:
                ToastUtils.showToast(UIUtils.getString(R.string.error204));
                break;
            case -50006:
                ToastUtils.showToast(UIUtils.getString(R.string.error205));
                break;
            case -50007:
                ToastUtils.showToast(UIUtils.getString(R.string.error206));
                break;
            case -60001:
                ToastUtils.showToast(UIUtils.getString(R.string.error21));
                break;
            case -517:
                ToastUtils.showToast(UIUtils.getString(R.string.error24));
                break;
            case -518:
                ToastUtils.showToast(UIUtils.getString(R.string.error25));
                break;
            case -519:
                ToastUtils.showToast(UIUtils.getString(R.string.error26));
                break;
            case -520:
                ToastUtils.showToast(UIUtils.getString(R.string.error27));
                break;
            case -526:
                ToastUtils.showToast(UIUtils.getString(R.string.error28));
                break;
        }
    }
}